home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / GameSprocket SDKs / NetSprocket_SDK / Interfaces&Libraries / NetSprocket.h next >
Encoding:
C/C++ Source or Header  |  1999-10-29  |  17.4 KB  |  621 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        NetSprocket.h
  3.  
  4.      Contains:    Games Sprockets: NetSprocket interfaces
  5.  
  6.      Version:    Technology:    NetSprocket 1.7
  7.                  Release:    NetSprocket SDK, Use with 3.2 Universal Headers
  8.  
  9.      Copyright:    © 1996-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __NETSPROCKET__
  18. #define __NETSPROCKET__
  19.  
  20. #ifndef __CONDITIONALMACROS__
  21. #include <ConditionalMacros.h>
  22. #endif
  23.  
  24.  
  25. #if TARGET_OS_MAC
  26. #ifndef __MACTYPES__
  27. #include <MacTypes.h>
  28. #endif
  29.  
  30. #ifndef __EVENTS__
  31. #include <Events.h>
  32. #endif
  33.  
  34.  
  35. #include <OpenTransport.h>
  36. #include <OpenTptInternet.h>
  37.  
  38. #endif  /* TARGET_OS_MAC */
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=power
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62. #if TARGET_OS_MAC
  63. enum {
  64.     kNSpMaxPlayerNameLen        = 31,
  65.     kNSpMaxGroupNameLen            = 31,
  66.     kNSpMaxPasswordLen            = 31,
  67.     kNSpMaxGameNameLen            = 31,
  68.     kNSpMaxDefinitionStringLen    = 255
  69. };
  70.  
  71.  
  72. /* NetSprocket basic types */
  73. typedef struct OpaqueNSpGameReference*     NSpGameReference;
  74. typedef struct OpaqueNSpProtocolReference*  NSpProtocolReference;
  75. typedef struct OpaqueNSpProtocolListReference*  NSpProtocolListReference;
  76. typedef struct OpaqueNSpAddressReference*  NSpAddressReference;
  77. typedef SInt32                             NSpEventCode;
  78. typedef SInt32                             NSpGameID;
  79. typedef SInt32                             NSpPlayerID;
  80. typedef NSpPlayerID                     NSpGroupID;
  81. typedef UInt32                             NSpPlayerType;
  82. typedef SInt32                             NSpFlags;
  83. typedef Str31                             NSpPlayerName;
  84. /* Individual player info */
  85.  
  86.     struct NSpPlayerInfo {
  87.         NSpPlayerID                     id;
  88.         NSpPlayerType                     type;
  89.         Str31                             name;
  90.         UInt32                             groupCount;
  91.         NSpGroupID                         groups[1];
  92.     };
  93.     typedef struct NSpPlayerInfo NSpPlayerInfo;
  94.     
  95. typedef NSpPlayerInfo *                    NSpPlayerInfoPtr;
  96. /* list of all players */
  97.  
  98. struct NSpPlayerEnumeration {
  99.     UInt32                             count;
  100.     NSpPlayerInfoPtr                 playerInfo[1];
  101. };
  102. typedef struct NSpPlayerEnumeration        NSpPlayerEnumeration;
  103. typedef NSpPlayerEnumeration *            NSpPlayerEnumerationPtr;
  104. /* Individual group info */
  105.  
  106. struct NSpGroupInfo {
  107.     NSpGroupID                         id;
  108.     UInt32                             playerCount;
  109.     NSpPlayerID                     players[1];
  110. };
  111. typedef struct NSpGroupInfo                NSpGroupInfo;
  112. typedef NSpGroupInfo *                    NSpGroupInfoPtr;
  113. /* List of all groups */
  114.  
  115. struct NSpGroupEnumeration {
  116.     UInt32                             count;
  117.     NSpGroupInfoPtr                 groups[1];
  118. };
  119. typedef struct NSpGroupEnumeration        NSpGroupEnumeration;
  120. typedef NSpGroupEnumeration *            NSpGroupEnumerationPtr;
  121. /* Topology types */
  122.  
  123. typedef UInt32                             NSpTopology;
  124. enum {
  125.     kNSpClientServer            = 0x00000001
  126. };
  127.  
  128. /* Game information */
  129.  
  130. struct NSpGameInfo {
  131.     UInt32                             maxPlayers;
  132.     UInt32                             currentPlayers;
  133.     UInt32                             currentGroups;
  134.     NSpTopology                     topology;
  135.     UInt32                             reserved;
  136.     Str31                             name;
  137.     Str31                             password;
  138. };
  139. typedef struct NSpGameInfo                NSpGameInfo;
  140. /* Structure used for sending and receiving network messages */
  141. struct NSpMessageHeader {
  142.     UInt32                             version;                    /* Used by NetSprocket.  Don't touch this */
  143.     SInt32                             what;                        /* The kind of message (e.g. player joined) */
  144.     NSpPlayerID                     from;                        /* ID of the sender */
  145.     NSpPlayerID                     to;                            /* (player or group) id of the intended recipient */
  146.     UInt32                             id;                            /* Unique ID for this message & (from) player */
  147.     UInt32                             when;                        /* Timestamp for the message */
  148.     UInt32                             messageLen;                    /* Bytes of data in the entire message (including the header) */
  149. };
  150. typedef struct NSpMessageHeader NSpMessageHeader;
  151. /* NetSprocket-defined message structures */
  152.  
  153. struct NSpErrorMessage {
  154.     NSpMessageHeader                 header;
  155.     OSStatus                         error;
  156. };
  157. typedef struct NSpErrorMessage            NSpErrorMessage;
  158.  
  159. struct NSpJoinRequestMessage {
  160.     NSpMessageHeader                 header;
  161.     Str31                             name;
  162.     Str31                             password;
  163.     UInt32                             theType;
  164.     UInt32                             customDataLen;
  165.     UInt8                             customData[1];
  166. };
  167. typedef struct NSpJoinRequestMessage    NSpJoinRequestMessage;
  168.  
  169. struct NSpJoinApprovedMessage {
  170.     NSpMessageHeader                 header;
  171. };
  172. typedef struct NSpJoinApprovedMessage    NSpJoinApprovedMessage;
  173.  
  174. struct NSpJoinDeniedMessage {
  175.     NSpMessageHeader                 header;
  176.     Str255                             reason;
  177. };
  178. typedef struct NSpJoinDeniedMessage        NSpJoinDeniedMessage;
  179.  
  180. struct NSpPlayerJoinedMessage {
  181.     NSpMessageHeader                 header;
  182.     UInt32                             playerCount;
  183.     NSpPlayerInfo                     playerInfo;
  184. };
  185. typedef struct NSpPlayerJoinedMessage    NSpPlayerJoinedMessage;
  186.  
  187. struct NSpPlayerLeftMessage {
  188.     NSpMessageHeader                 header;
  189.     UInt32                             playerCount;
  190.     NSpPlayerID                     playerID;
  191.     NSpPlayerName                     playerName;
  192. };
  193. typedef struct NSpPlayerLeftMessage        NSpPlayerLeftMessage;
  194.  
  195. struct NSpHostChangedMessage {
  196.     NSpMessageHeader                 header;
  197.     NSpPlayerID                     newHost;
  198. };
  199. typedef struct NSpHostChangedMessage    NSpHostChangedMessage;
  200.  
  201. struct NSpGameTerminatedMessage {
  202.     NSpMessageHeader                 header;
  203. };
  204. typedef struct NSpGameTerminatedMessage    NSpGameTerminatedMessage;
  205.  
  206. struct NSpCreateGroupMessage {
  207.     NSpMessageHeader                 header;
  208.     NSpGroupID                         groupID;
  209.     NSpPlayerID                     requestingPlayer;
  210. };
  211. typedef struct NSpCreateGroupMessage    NSpCreateGroupMessage;
  212.  
  213. struct NSpDeleteGroupMessage {
  214.     NSpMessageHeader                 header;
  215.     NSpGroupID                         groupID;
  216.     NSpPlayerID                     requestingPlayer;
  217. };
  218. typedef struct NSpDeleteGroupMessage    NSpDeleteGroupMessage;
  219.  
  220. struct NSpAddPlayerToGroupMessage {
  221.     NSpMessageHeader                 header;
  222.     NSpGroupID                         group;
  223.     NSpPlayerID                     player;
  224. };
  225. typedef struct NSpAddPlayerToGroupMessage NSpAddPlayerToGroupMessage;
  226.  
  227. struct NSpRemovePlayerFromGroupMessage {
  228.     NSpMessageHeader                 header;
  229.     NSpGroupID                         group;
  230.     NSpPlayerID                     player;
  231. };
  232. typedef struct NSpRemovePlayerFromGroupMessage NSpRemovePlayerFromGroupMessage;
  233.  
  234. struct NSpPlayerTypeChangedMessage {
  235.     NSpMessageHeader                 header;
  236.     NSpPlayerID                     player;
  237.     NSpPlayerType                     newType;
  238. };
  239. typedef struct NSpPlayerTypeChangedMessage NSpPlayerTypeChangedMessage;
  240. /* Different kinds of messages.  These can NOT be bitwise ORed together */
  241. enum {
  242.     kNSpSendFlag_Junk            = 0x00100000,                    /* will be sent (try once) when there is nothing else pending */
  243.     kNSpSendFlag_Normal            = 0x00200000,                    /* will be sent immediately (try once) */
  244.     kNSpSendFlag_Registered        = 0x00400000                    /* will be sent immediately (guaranteed, in order) */
  245. };
  246.  
  247.  
  248. /* Options for message delivery.  These can be bitwise ORed together with each other,
  249.         as well as with ONE of the above */
  250. enum {
  251.     kNSpSendFlag_FailIfPipeFull    = 0x00000001,
  252.     kNSpSendFlag_SelfSend        = 0x00000002,
  253.     kNSpSendFlag_Blocking        = 0x00000004
  254. };
  255.  
  256.  
  257. /* Options for Hosting Joining, and Deleting games */
  258. enum {
  259.     kNSpGameFlag_DontAdvertise    = 0x00000001,
  260.     kNSpGameFlag_ForceTerminateGame = 0x00000002
  261. };
  262.  
  263. /* Message "what" types */
  264. /* Apple reserves all negative "what" values (anything with high bit set) */
  265. enum {
  266.     kNSpSystemMessagePrefix        = (long)0x80000000,
  267.     kNSpError                    = kNSpSystemMessagePrefix | 0x7FFFFFFF,
  268.     kNSpJoinRequest                = kNSpSystemMessagePrefix | 0x00000001,
  269.     kNSpJoinApproved            = kNSpSystemMessagePrefix | 0x00000002,
  270.     kNSpJoinDenied                = kNSpSystemMessagePrefix | 0x00000003,
  271.     kNSpPlayerJoined            = kNSpSystemMessagePrefix | 0x00000004,
  272.     kNSpPlayerLeft                = kNSpSystemMessagePrefix | 0x00000005,
  273.     kNSpHostChanged                = kNSpSystemMessagePrefix | 0x00000006,
  274.     kNSpGameTerminated            = kNSpSystemMessagePrefix | 0x00000007,
  275.     kNSpGroupCreated            = kNSpSystemMessagePrefix | 0x00000008,
  276.     kNSpGroupDeleted            = kNSpSystemMessagePrefix | 0x00000009,
  277.     kNSpPlayerAddedToGroup        = kNSpSystemMessagePrefix | 0x0000000A,
  278.     kNSpPlayerRemovedFromGroup    = kNSpSystemMessagePrefix | 0x0000000B,
  279.     kNSpPlayerTypeChanged        = kNSpSystemMessagePrefix | 0x0000000C
  280. };
  281.  
  282.  
  283. /* Special TPlayerIDs  for sending messages */
  284. enum {
  285.     kNSpAllPlayers                = 0x00000000,
  286.     kNSpHostOnly                = (long)0xFFFFFFFF
  287. };
  288.  
  289.  
  290. /* NetSprocket Error Codes */
  291. enum {
  292.     kNSpInitializationFailedErr    = -30360,
  293.     kNSpAlreadyInitializedErr    = -30361,
  294.     kNSpTopologyNotSupportedErr    = -30362,
  295.     kNSpPipeFullErr                = -30364,
  296.     kNSpHostFailedErr            = -30365,
  297.     kNSpProtocolNotAvailableErr    = -30366,
  298.     kNSpInvalidGameRefErr        = -30367,
  299.     kNSpInvalidParameterErr        = -30369,
  300.     kNSpOTNotPresentErr            = -30370,
  301.     kNSpOTVersionTooOldErr        = -30371,
  302.     kNSpMemAllocationErr        = -30373,
  303.     kNSpAlreadyAdvertisingErr    = -30374,
  304.     kNSpNotAdvertisingErr        = -30376,
  305.     kNSpInvalidAddressErr        = -30377,
  306.     kNSpFreeQExhaustedErr        = -30378,
  307.     kNSpRemovePlayerFailedErr    = -30379,
  308.     kNSpAddressInUseErr            = -30380,
  309.     kNSpFeatureNotImplementedErr = -30381,
  310.     kNSpNameRequiredErr            = -30382,
  311.     kNSpInvalidPlayerIDErr        = -30383,
  312.     kNSpInvalidGroupIDErr        = -30384,
  313.     kNSpNoPlayersErr            = -30385,
  314.     kNSpNoGroupsErr                = -30386,
  315.     kNSpNoHostVolunteersErr        = -30387,
  316.     kNSpCreateGroupFailedErr    = -30388,
  317.     kNSpAddPlayerFailedErr        = -30389,
  318.     kNSpInvalidDefinitionErr    = -30390,
  319.     kNSpInvalidProtocolRefErr    = -30391,
  320.     kNSpInvalidProtocolListErr    = -30392,
  321.     kNSpTimeoutErr                = -30393,
  322.     kNSpGameTerminatedErr        = -30394,
  323.     kNSpConnectFailedErr        = -30395,
  324.     kNSpSendFailedErr            = -30396,
  325.     kNSpMessageTooBigErr        = -30397,
  326.     kNSpCantBlockErr            = -30398,
  327.     kNSpJoinFailedErr            = -30399
  328. };
  329.  
  330.  
  331.  
  332.  
  333. /************************  Initialization  ************************/
  334. EXTERN_API_C( OSStatus )
  335. NSpInitialize                    (UInt32                 inStandardMessageSize,
  336.                                  UInt32                 inBufferSize,
  337.                                  UInt32                 inQElements,
  338.                                  NSpGameID                 inGameID,
  339.                                  UInt32                 inTimeout);
  340.  
  341.  
  342.  
  343.  
  344. /**************************  Protocols  **************************/
  345. /* Programmatic protocol routines */
  346. EXTERN_API_C( OSStatus )
  347. NSpProtocol_New                    (const char *            inDefinitionString,
  348.                                  NSpProtocolReference *    outReference);
  349.  
  350. EXTERN_API_C( void )
  351. NSpProtocol_Dispose                (NSpProtocolReference     inProtocolRef);
  352.  
  353. EXTERN_API_C( OSStatus )
  354. NSpProtocol_ExtractDefinitionString (NSpProtocolReference  inProtocolRef,
  355.                                  char *                    outDefinitionString);
  356.  
  357.  
  358. /* Protocol list routines */
  359. EXTERN_API_C( OSStatus )
  360. NSpProtocolList_New                (NSpProtocolReference     inProtocolRef,
  361.                                  NSpProtocolListReference * outList);
  362.  
  363. EXTERN_API_C( void )
  364. NSpProtocolList_Dispose            (NSpProtocolListReference  inProtocolList);
  365.  
  366. EXTERN_API_C( OSStatus )
  367. NSpProtocolList_Append            (NSpProtocolListReference  inProtocolList,
  368.                                  NSpProtocolReference     inProtocolRef);
  369.  
  370. EXTERN_API_C( OSStatus )
  371. NSpProtocolList_Remove            (NSpProtocolListReference  inProtocolList,
  372.                                  NSpProtocolReference     inProtocolRef);
  373.  
  374. EXTERN_API_C( OSStatus )
  375. NSpProtocolList_RemoveIndexed    (NSpProtocolListReference  inProtocolList,
  376.                                  UInt32                 inIndex);
  377.  
  378. EXTERN_API_C( UInt32 )
  379. NSpProtocolList_GetCount        (NSpProtocolListReference  inProtocolList);
  380.  
  381. EXTERN_API_C( NSpProtocolReference )
  382. NSpProtocolList_GetIndexedRef    (NSpProtocolListReference  inProtocolList,
  383.                                  UInt32                 inIndex);
  384.  
  385.  
  386. /* Helpers */
  387. EXTERN_API_C( NSpProtocolReference )
  388. NSpProtocol_CreateAppleTalk        (ConstStr31Param         inNBPName,
  389.                                  ConstStr31Param         inNBPType,
  390.                                  UInt32                 inMaxRTT,
  391.                                  UInt32                 inMinThruput);
  392.  
  393. EXTERN_API_C( NSpProtocolReference )
  394. NSpProtocol_CreateIP            (InetPort                 inPort,
  395.                                  UInt32                 inMaxRTT,
  396.                                  UInt32                 inMinThruput);
  397.  
  398.  
  399. /***********************  Human Interface  ************************/
  400. typedef CALLBACK_API( Boolean , NSpEventProcPtr )(EventRecord *inEvent);
  401. EXTERN_API_C( NSpAddressReference )
  402. NSpDoModalJoinDialog            (ConstStr31Param         inGameType,
  403.                                  ConstStr255Param         inEntityListLabel,
  404.                                  Str31                     ioName,
  405.                                  Str31                     ioPassword,
  406.                                  NSpEventProcPtr         inEventProcPtr);
  407.  
  408. EXTERN_API_C( Boolean )
  409. NSpDoModalHostDialog            (NSpProtocolListReference  ioProtocolList,
  410.                                  Str31                     ioGameName,
  411.                                  Str31                     ioPlayerName,
  412.                                  Str31                     ioPassword,
  413.                                  NSpEventProcPtr         inEventProcPtr);
  414.  
  415.  
  416. /*********************  Hosting and Joining  **********************/
  417. EXTERN_API_C( OSStatus )
  418. NSpGame_Host                    (NSpGameReference *        outGame,
  419.                                  NSpProtocolListReference  inProtocolList,
  420.                                  UInt32                 inMaxPlayers,
  421.                                  ConstStr31Param         inGameName,
  422.                                  ConstStr31Param         inPassword,
  423.                                  ConstStr31Param         inPlayerName,
  424.                                  NSpPlayerType             inPlayerType,
  425.                                  NSpTopology             inTopology,
  426.                                  NSpFlags                 inFlags);
  427.  
  428. EXTERN_API_C( OSStatus )
  429. NSpGame_Join                    (NSpGameReference *        outGame,
  430.                                  NSpAddressReference     inAddress,
  431.                                  ConstStr31Param         inName,
  432.                                  ConstStr31Param         inPassword,
  433.                                  NSpPlayerType             inType,
  434.                                  void *                    inCustomData,
  435.                                  UInt32                 inCustomDataLen,
  436.                                  NSpFlags                 inFlags);
  437.  
  438. EXTERN_API_C( OSStatus )
  439. NSpGame_EnableAdvertising        (NSpGameReference         inGame,
  440.                                  NSpProtocolReference     inProtocol,
  441.                                  Boolean                 inEnable);
  442.  
  443. EXTERN_API_C( OSStatus )
  444. NSpGame_Dispose                    (NSpGameReference         inGame,
  445.                                  NSpFlags                 inFlags);
  446.  
  447. EXTERN_API_C( OSStatus )
  448. NSpGame_GetInfo                    (NSpGameReference         inGame,
  449.                                  NSpGameInfo *            ioInfo);
  450.  
  451. /**************************  Messaging  **************************/
  452. EXTERN_API_C( OSStatus )
  453. NSpMessage_Send                    (NSpGameReference         inGame,
  454.                                  NSpMessageHeader *        inMessage,
  455.                                  NSpFlags                 inFlags);
  456.  
  457. EXTERN_API_C( NSpMessageHeader *)
  458. NSpMessage_Get                    (NSpGameReference         inGame);
  459.  
  460. EXTERN_API_C( void )
  461. NSpMessage_Release                (NSpGameReference         inGame,
  462.                                  NSpMessageHeader *        inMessage);
  463.  
  464. /* Helpers */
  465. EXTERN_API_C( OSStatus )
  466. NSpMessage_SendTo                (NSpGameReference         inGame,
  467.                                  NSpPlayerID             inTo,
  468.                                  SInt32                 inWhat,
  469.                                  void *                    inData,
  470.                                  UInt32                 inDataLen,
  471.                                  NSpFlags                 inFlags);
  472.  
  473.  
  474. /*********************  Player Information  **********************/
  475. EXTERN_API_C( OSStatus )
  476. NSpPlayer_ChangeType            (NSpGameReference         inGame,
  477.                                  NSpPlayerID             inPlayerID,
  478.                                  NSpPlayerType             inNewType);
  479.  
  480. EXTERN_API_C( OSStatus )
  481. NSpPlayer_Remove                (NSpGameReference         inGame,
  482.                                  NSpPlayerID             inPlayerID);
  483.  
  484. EXTERN_API_C( OSStatus )
  485. NSpPlayer_GetAddress            (NSpGameReference         inGame,
  486.                                  NSpPlayerID             inPlayerID,
  487.                                  OTAddress **            outAddress);
  488.  
  489. EXTERN_API_C( NSpPlayerID )
  490. NSpPlayer_GetMyID                (NSpGameReference         inGame);
  491.  
  492. EXTERN_API_C( OSStatus )
  493. NSpPlayer_GetInfo                (NSpGameReference         inGame,
  494.                                  NSpPlayerID             inPlayerID,
  495.                                  NSpPlayerInfoPtr *        outInfo);
  496.  
  497. EXTERN_API_C( void )
  498. NSpPlayer_ReleaseInfo            (NSpGameReference         inGame,
  499.                                  NSpPlayerInfoPtr         inInfo);
  500.  
  501. EXTERN_API_C( OSStatus )
  502. NSpPlayer_GetEnumeration        (NSpGameReference         inGame,
  503.                                  NSpPlayerEnumerationPtr * outPlayers);
  504.  
  505. EXTERN_API_C( void )
  506. NSpPlayer_ReleaseEnumeration    (NSpGameReference         inGame,
  507.                                  NSpPlayerEnumerationPtr  inPlayers);
  508.  
  509. EXTERN_API_C( UInt32 )
  510. NSpPlayer_GetRoundTripTime        (NSpGameReference         inGame,
  511.                                  NSpPlayerID             inPlayer);
  512.  
  513. EXTERN_API_C( UInt32 )
  514. NSpPlayer_GetThruput            (NSpGameReference         inGame,
  515.                                  NSpPlayerID             inPlayer);
  516.  
  517.  
  518. /*********************  Group Management  **********************/
  519. EXTERN_API_C( OSStatus )
  520. NSpGroup_New                    (NSpGameReference         inGame,
  521.                                  NSpGroupID *            outGroupID);
  522.  
  523. EXTERN_API_C( OSStatus )
  524. NSpGroup_Dispose                (NSpGameReference         inGame,
  525.                                  NSpGroupID             inGroupID);
  526.  
  527. EXTERN_API_C( OSStatus )
  528. NSpGroup_AddPlayer                (NSpGameReference         inGame,
  529.                                  NSpGroupID             inGroupID,
  530.                                  NSpPlayerID             inPlayerID);
  531.  
  532. EXTERN_API_C( OSStatus )
  533. NSpGroup_RemovePlayer            (NSpGameReference         inGame,
  534.                                  NSpGroupID             inGroupID,
  535.                                  NSpPlayerID             inPlayerID);
  536.  
  537. EXTERN_API_C( OSStatus )
  538. NSpGroup_GetInfo                (NSpGameReference         inGame,
  539.                                  NSpGroupID             inGroupID,
  540.                                  NSpGroupInfoPtr *        outInfo);
  541.  
  542. EXTERN_API_C( void )
  543. NSpGroup_ReleaseInfo            (NSpGameReference         inGame,
  544.                                  NSpGroupInfoPtr         inInfo);
  545.  
  546. EXTERN_API_C( OSStatus )
  547. NSpGroup_GetEnumeration            (NSpGameReference         inGame,
  548.                                  NSpGroupEnumerationPtr * outGroups);
  549.  
  550. EXTERN_API_C( void )
  551. NSpGroup_ReleaseEnumeration        (NSpGameReference         inGame,
  552.                                  NSpGroupEnumerationPtr  inGroups);
  553.  
  554.  
  555. /**************************  Utilities  ***************************/
  556. EXTERN_API_C( NumVersion )
  557. NSpGetVersion                    (void);
  558.  
  559. EXTERN_API_C( void )
  560. NSpSetConnectTimeout            (UInt32                 inSeconds);
  561.  
  562. EXTERN_API_C( void )
  563. NSpClearMessageHeader            (NSpMessageHeader *        inMessage);
  564.  
  565. EXTERN_API_C( UInt32 )
  566. NSpGetCurrentTimeStamp            (NSpGameReference         inGame);
  567.  
  568. EXTERN_API_C( NSpAddressReference )
  569. NSpConvertOTAddrToAddressReference (OTAddress *            inAddress);
  570.  
  571. EXTERN_API_C( OTAddress *)
  572. NSpConvertAddressReferenceToOTAddr (NSpAddressReference  inAddress);
  573.  
  574. EXTERN_API_C( void )
  575. NSpReleaseAddressReference        (NSpAddressReference     inAddress);
  576.  
  577.  
  578. /************************ Advanced/Async routines ****************/
  579. typedef CALLBACK_API( void , NSpCallbackProcPtr )(NSpGameReference inGame, void *inContext, NSpEventCode inCode, OSStatus inStatus, void *inCookie);
  580. EXTERN_API_C( OSStatus )
  581. NSpInstallCallbackHandler        (NSpCallbackProcPtr     inHandler,
  582.                                  void *                    inContext);
  583.  
  584.  
  585. typedef CALLBACK_API( Boolean , NSpJoinRequestHandlerProcPtr )(NSpGameReference inGame, NSpJoinRequestMessage *inMessage, void *inContext, Str255 outReason);
  586. EXTERN_API_C( OSStatus )
  587. NSpInstallJoinRequestHandler    (NSpJoinRequestHandlerProcPtr  inHandler,
  588.                                  void *                    inContext);
  589.  
  590.  
  591. typedef CALLBACK_API( Boolean , NSpMessageHandlerProcPtr )(NSpGameReference inGame, NSpMessageHeader *inMessage, void *inContext);
  592. EXTERN_API_C( OSStatus )
  593. NSpInstallAsyncMessageHandler    (NSpMessageHandlerProcPtr  inHandler,
  594.                                  void *                    inContext);
  595.  
  596.  
  597.  
  598. #endif  /* TARGET_OS_MAC */
  599.  
  600.  
  601. #if PRAGMA_STRUCT_ALIGN
  602.     #pragma options align=reset
  603. #elif PRAGMA_STRUCT_PACKPUSH
  604.     #pragma pack(pop)
  605. #elif PRAGMA_STRUCT_PACK
  606.     #pragma pack()
  607. #endif
  608.  
  609. #ifdef PRAGMA_IMPORT_OFF
  610. #pragma import off
  611. #elif PRAGMA_IMPORT
  612. #pragma import reset
  613. #endif
  614.  
  615. #ifdef __cplusplus
  616. }
  617. #endif
  618.  
  619. #endif /* __NETSPROCKET__ */
  620.  
  621.